Skip to main content
Tools for changing projection parameters (center longitude, standard parallel) without resampling, preserving original pixel values while updating geospatial registration.

Overview

These utilities modify the geospatial metadata and registration of equirectangular (and similar cylindrical) projections without resampling image data. This approach:
  • ✅ Preserves original pixel values exactly
  • ✅ Avoids interpolation artifacts
  • ✅ Executes rapidly (no pixel processing)
  • ⚠️ Only works for specific projection types
These tools should only be used with Simple Cylindrical, Equirectangular, and possibly Mercator projections. Using them with other projections will produce geometrically incorrect results.

NewCenterLon_Equi.py

Changes the center longitude (central meridian) without reprojecting.

Usage

-of
string
default:"GTiff"
Output format (GDAL driver name: GTiff, HFA, ISIS3, etc.)
-clon
float
required
New center longitude value in decimal degrees
infile
string
required
Path to input raster file
outfile
string
required
Path to output raster file
Syntax:
python NewCenterLon_Equi.py [-of format] -clon newClon infile outfile

Examples

python NewCenterLon_Equi.py -clon 0 global_180.tif global_0.tif

How It Works

1

Read projection information

Extract the current spatial reference system and geotransformation matrix
2

Calculate longitude offset

Determine the shift in X coordinates based on center longitude change:
delta_clon = new_clon - old_clon
3

Update geotransform

Modify the X origin in the geotransformation matrix without touching pixel data
4

Update projection WKT

Change the central_meridian parameter in the projection definition
5

Write output

Copy pixel data unchanged, apply new geotransform and projection

Use Cases

Global Map Conventions

Convert between -180° to 180° and 0° to 360° longitude systems

Seam Repositioning

Move the map edge seam to a different longitude

Regional Centering

Center the map on a specific feature or region of interest

Multi-Body Data

Standardize center longitude across planetary datasets

NewStandardPar_Equi.py

Changes the standard parallel (latitude of true scale) without reprojecting.

Usage

-of
string
default:"GTiff"
Output format (GDAL driver name)
-clat
float
required
New standard parallel latitude in decimal degrees
infile
string
required
Path to input raster file
outfile
string
required
Path to output raster file
Syntax:
python NewStandardPar_Equi.py [-of format] -clat newClat infile outfile

Examples

python NewStandardPar_Equi.py -clat 45 equator_scale.tif midlat_scale.tif

How It Works

1

Calculate scale factor

Determine how X pixel spacing changes with new latitude of true scale:
scale_factor = cos(new_clat) / cos(old_clat)
2

Adjust X resolution

Modify geotransform X pixel size while keeping Y resolution constant
3

Update projection definition

Change standard_parallel_1 or latitude_of_origin parameter
4

Write output

Copy pixel data with updated geotransform (rectangular pixels possible)
Result: The output may have rectangular pixels (different X and Y resolution) because only the X spacing is scaled.

Use Cases

Split Global Mosaics

Prepare latitude bands with appropriate scale for each zone

Regional Processing

Optimize scale distortion for specific latitude ranges

Conformality Adjustment

Match scale characteristics to analysis requirements

Legacy Data Correction

Update old maps with incorrect standard parallel metadata

Example Workflow: Global Lunar Split

The repository includes an example for splitting a global lunar map into 5-degree latitude bands: Files:
  • global_lunar_split_example/NewStandardPar_Equi.py
  • global_lunar_split_example/split_equi_5deg_lat_bands.py
Process:
1

Split into latitude bands

Use gdal_translate to extract 5° latitude strips
2

Adjust standard parallel

Apply NewStandardPar_Equi.py with the central latitude of each band
3

Result

Each band has minimal scale distortion at its central latitude

Technical Background

Equirectangular Projection

Also known as Plate Carrée or Simple Cylindrical, this projection maps:
X = R * (λ - λ₀) * cos(φ₁)
Y = R * φ
Where:
  • λ = longitude
  • λ₀ = center longitude (central meridian)
  • φ = latitude
  • φ₁ = standard parallel (latitude of true scale)
  • R = radius of the sphere/ellipsoid

Why No Resampling Works

Equirectangular projection has a linear relationship between pixel coordinates and ground coordinates. Changing the center longitude simply shifts all X coordinates by a constant amount:
X_new = X_old + ΔX
where ΔX = R * Δλ₀ * cos(φ₁)
Similarly, changing standard parallel scales X coordinates uniformly:
X_new = X_old * (cos(φ₁_new) / cos(φ₁_old))
Because the pixel grid doesn’t need to be warped or rotated, we can simply update the geotransformation coefficients.

Geotransformation Update

Standard GDAL geotransform:
geomatrix = [
    ulx,    # [0] Upper-left X coordinate
    xres,   # [1] X pixel resolution  
    0,      # [2] X rotation (typically 0)
    uly,    # [3] Upper-left Y coordinate
    0,      # [4] Y rotation (typically 0)
    yres    # [5] Y pixel resolution (negative for north-up)
]
Center longitude change: Modify geomatrix[0] (ulx)
Standard parallel change: Modify geomatrix[1] (xres)

Requirements

pip install gdal
Both scripts support:
  • Modern GDAL Python bindings: from osgeo import gdal
  • Legacy bindings: import gdal

Supported Output Formats

Common GDAL format codes for -of parameter:

GTiff

GeoTIFF (default)

HFA

Erdas Imagine .img

ISIS3

USGS ISIS3 cube

ENVI

ENVI .dat + .hdr

AAIGrid

Arc/Info ASCII Grid

JPEG

JPEG (loses georeferencing)
See gdal_translate --formats for full list.

Validation

After running these scripts, verify the output:
1

Check projection parameters

gdalinfo output.tif | grep -A 10 "Coordinate System"
2

Verify corner coordinates

gdalinfo output.tif | grep -A 4 "Corner Coordinates"
3

Test coordinate transformation

Use gdallocationinfo to verify pixel-to-ground coordinate mapping
4

Visual inspection

Open in QGIS or other GIS software with graticule overlay

Credits

Author: Trent Hare, USGS
Based on: tolatlong.py by Andrey Kiselev (dron@remotesensing.org)
Project: Lunar Mapping and Modeling Project (LMMP)
These scripts were developed for planetary mapping workflows but work equally well for terrestrial data in appropriate projections.